package com.sdonkey.score.model;

import org.apache.commons.lang.StringUtils;

/**
 * 
 * 广告主  广告列表显示内容，广告查看内容
 * 
 * @author zhaoxiaobo
 *
 */
public class TadCustom extends Tad {
	public String terminalTypeShow() {

		String terminalType = "";
		if (StringUtils.isNotBlank(super.getMobileVersionUrl())) {
			terminalType += "手机";
		}

		if (StringUtils.isNotBlank(super.getPadVersionUrl())) {
			terminalType += " PC";
		}

		if (StringUtils.isNotBlank(super.getPadVersionUrl())) {
			terminalType += " PAD";
		}

		if (StringUtils.isNotBlank(super.getTvVersionUrl())) {
			terminalType += " 互联网电视";
		}
		return terminalType;
	}

	public String statusShow() {
		String statusShow = "";
		if ("-1".equals(super.getStatus())) {
			statusShow = "审核未通过";
		} else if ("0".equals(super.getStatus())) {
			statusShow = "审核中";
		} else if ("1".equals(super.getStatus())) {
			statusShow = "审核通过";
		} else if ("2".equals(super.getStatus())) {
			statusShow = "投放中";
		} else if ("3".equals(super.getStatus())) {
			statusShow = "暂停投放";
		} else if ("4".equals(super.getStatus())) {
			statusShow = "投放结束";
		}
		return statusShow;
	}

	public String adTypeShow() {
		String adTypeShow = "";
		if ("video".equals(super.getAdType())) {
			adTypeShow = "视频";
		} else if ("picture".equals(super.getAdType())) {
			adTypeShow = "图片";
		}
		return adTypeShow;
	}
	
	
	//----------------查看--------------------
	/*public void transform() {

		if (StringUtils.isBlank(super.getMobileVersionUrl())) {
			// this.mobileVUrl = null;
		} else {
			if ("video".equals(super.getAdType())) {
				super.setMobileVersionUrl(FileUploadTool.SHOW_VIDEO_PRE+ super.getMobileVersionUrl());
			} else if ("picture".equals(super.getAdType())) {
				super.setMobileVersionUrl(FileUploadTool.SHOW_IMG_PRE + super.getMobileVersionUrl());
				
			}
		}

		if (StringUtils.isBlank(super.getPcVersionUrl())) {
			// this.pcVUrl = null;
		} else {
			if ("video".equals(super.getAdType())) {
				super.setPcVersionUrl(FileUploadTool.SHOW_VIDEO_PRE + super.getPcVersionUrl());
			} else if ("picture".equals(super.getAdType())) {
				super.setPcVersionUrl(FileUploadTool.SHOW_IMG_PRE + super.getPcVersionUrl());
			}
		}

		if (StringUtils.isBlank(super.getPadVersionUrl())) {
			// this.padVUrl = null;
		} else {
			if ("video".equals(super.getAdType())) {
				super.setPadVersionUrl(FileUploadTool.SHOW_VIDEO_PRE +super.getPadVersionUrl());
				;
			} else if ("picture".equals(super.getAdType())) {
				super.setPadVersionUrl(FileUploadTool.SHOW_IMG_PRE + super.getPadVersionUrl());
			}
		}

		if (StringUtils.isBlank(super.getTvVersionUrl())) {
			// this.tvVUrl = null;
		} else {
			if ("video".equals(super.getAdType())) {
				super.setTvVersionUrl(FileUploadTool.SHOW_VIDEO_PRE + super.getTvVersionUrl());
			} else if ("picture".equals(super.getAdType())) {
				super.setTvVersionUrl( FileUploadTool.SHOW_IMG_PRE + super.getTvVersionUrl());
			}
		}

		if (StringUtils.isBlank(super.getAdHomepage())) {
			// this.adHomepage = null;
		} else {
			super.setAdHomepage(FileUploadTool.SHOW_IMG_PRE + super.getAdHomepage());
		}
	}*/
	
	

	public void transAdkey() {
		if (StringUtils.isNotBlank(super.getAdKey())) {
			super.setAdKey(super.getAdKey().replace("null", ""));
			String[] keys = super.getAdKey().split("\\|");
		}
	}
}
